package com.kfm.company.controller;

import com.kfm.company.model.Person;
import com.kfm.company.model.ServerConfig;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.core.env.Environment;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

@Controller
public class TestController {

    @Autowired
    private Environment environment;

    @Autowired
    private Person person;

    @Autowired
    private ServerConfig serverConfig;

    @RequestMapping("/test")
    public String test() {
        String name = environment.getProperty("name");
        System.out.println(name);
        System.out.println(environment.getProperty("person.name"));
        System.out.println(environment.getProperty("province[2]"));
        System.out.println(environment.getProperty("student[0].name"));
        System.out.println(person);
        System.out.println(serverConfig);
        return "test";
    }
}
